<template>
	<view class="leaderboards">
		<!-- 顶部导航 -->
		<view class="top">
			<!-- #ifdef MP || APP-PLUS -->
			<view class="bgColor" :style="{ height: statusBarHeight}"></view>
			<!-- #endif -->
			<view class="header">
				<view class="head-menu" >
					<view class="iconfont icon-ic_leftarrow" @click="goback"></view>
					<view class="iconfont icon-ic_home" @click="goHome" ></view>
				</view>
			</view>
		</view>
		<!-- #ifdef MP || APP-PLUS -->
		<view :style="{ height: statusBarHeight}"></view>
		<!-- #endif -->
		<view class="container">
			<!-- <view class="banner">
				<u-swiper
					:list="bannerList"
					height="300"
				></u-swiper>
			</view> -->
			<view class="wrapper">
				<view class="header-tit">
					<view class="cell-1">
						排名
					</view>
					<view class="cell-2">
						用户
					</view>
					<view class="cell-3">
						累积渔获
					</view>
				</view>
				<view class="list-box">
					<view class="single" v-for="(item, index) in list" :key="item.id">
						<view class="s-left">
							<view class="num top3" v-if="index<3">
								<u-icon :name="`/static/images/No${index+1}.png`" size="30"></u-icon>
							</view>
							<view class="num" v-else>
								{{item.ranking}}
							</view>
							<view class="user">
								<view class="avatar">
									<u-avatar :src="item.pic" size="43" ></u-avatar>
								</view>
								<view class="nickname">
									{{item.nickname}}
								</view>
							</view>
						</view>
						<view class="s-right">
							{{item.integral}}斤/{{item.num}}尾
						</view>
					</view>
				</view>
			</view>
		</view>
		<storeTabbar :value="3" :storeId = "storeID"></storeTabbar>
		<home></home>
	</view>
</template>

<script>
	import home from '@/components/home';
	export default {
		components:{home},
		data(){
			return {
				storeID:null, // 商铺id
				statusBarHeight: 0,
				bannerList: [
                    'https://cdn.uviewui.com/uview/swiper/swiper1.png',
                    'https://cdn.uviewui.com/uview/swiper/swiper2.png',
                ],
				list:[
					{
						id:10,
						ranking:'1',
						pic:'https://cdn.uviewui.com/uview/album/1.jpg',
						nickname:'沫沫姐',
						integral:'523',
						num:42
					},
					{
						id:11,
						ranking:'2',
						pic:'https://cdn.uviewui.com/uview/album/2.jpg',
						nickname:'大刀',
						integral:'499',
						num:40
					},
					{
						id:12,
						ranking:'3',
						pic:'https://cdn.uviewui.com/uview/album/3.jpg',
						nickname:'小孩哥',
						integral:'480',
						num:39
					},
					{
						id:13,
						ranking:'4',
						pic:'https://cdn.uviewui.com/uview/album/4.jpg',
						nickname:'小孩姐',
						integral:'478',
						num:40
					},
					{
						id:14,
						ranking:'5',
						pic:'https://cdn.uviewui.com/uview/album/5.jpg',
						nickname:'大兵',
						integral:'468',
						num:32
					},
					{
						id:15,
						ranking:'6',
						pic:'https://cdn.uviewui.com/uview/album/6.jpg',
						nickname:'花裤衩',
						integral:'460',
						num:36
					}
				]
			}
		},
		onLoad(options) {
			this.storeID = Number(options.storeID);
			if (!options.storeID) return this.$util.Tips({
				title: '缺少参数无法查看钓场排行榜'
			}, {
				tab: 1,
				url: '/pages/fishingPond/index'
			});
			this.statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px';
		},
		methods:{
			goback: function() {
				// uni.navigateBack();
				uni.switchTab({
					url:'/pages/fishingPond/index'
				})
			},
			// 首页
			goHome() {
				uni.switchTab({
					url: '/pages/index/index'
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	page{}
	.leaderboards{
		.top{
			position: fixed;
			top: 0;
			width: 100%;
			z-index: 1000;
			.bgColor{
				background: #549CE3;
			}
			.header {
				position: relative;
				z-index: 6;
				display: flex;
				align-items: center;
				padding-right: 34rpx;
				height: 43px;
				padding-left: 33rpx;
				background: #549CE3;
				.head-menu {
					display: -webkit-box;
					display: -webkit-flex;
					display: flex;
					-webkit-box-align: center;
					-webkit-align-items: center;
					align-items: center;
					height: 27px;
					width: 70px;
					background: rgba(255,255,255,.8);
					border-radius: 13px;
					.icon-ic_leftarrow {
						font-size: 32rpx;
						color: #333333 !important;
					}
					.iconfont {
						-webkit-box-flex: 1;
						-webkit-flex: 1;
						flex: 1;
						text-align: center;
						color: #000000 !important;
						box-sizing: border-box;
						&.icon-ic_leftarrow {
							border-right: 1px solid rgba(000,000,000,.2) !important;
						}
					}
				}
			}
		}
		.container{
			margin-top: 43px;
			.wrapper{
				padding: 0 30rpx;
				margin-top: 100rpx;
				.header-tit{
					display: flex;
					padding: 20rpx 0;
					font-size: 26rpx;
					color: #6f6f6f;
					.cell-1{
						width: 110rpx;
						text-align: center;
					}
					.cell-2{
						flex: 1;
						padding-left: 20rpx;
					}
					.cell-3{
						width: 200rpx;
						text-align: center;
						color: #333333;
						font-weight: bold;
					}
				}
				.list-box{
					.single{
						background-color: #ffffff;
						display: flex;
						align-items: center;
						padding: 20rpx 0;
						border-radius:8px;
						margin-bottom: 20rpx;
						.s-left{
							display: flex;
							align-items: center;
							flex: 1;
							.num{
								width: 110rpx;
								text-align: center;
								font-size: 36rpx;
								color: #9f9f9f;
							}
							.top3{
								display: flex;
								align-items: center;
								justify-content: center;
							}
							.user{
								flex: 1;
								display: flex;
								align-items: center;
								.avatar{
									border: 2px solid #ffffff;
									border-radius: 100%;
								}
								.nickname{
									margin-left: 20rpx;
									font-size: 28rpx;
									color: #3f3f3f;
								}
							}
						}
						.s-right{
							width: 200rpx;
							text-align: center;
							font-weight: bold;
							color: #6f6f6f;
							font-size: 26rpx;
						}
					}
					.single:nth-child(1) {
					   background: linear-gradient(to right, #f2e0c7, #fff 80%);
					}
					.single:nth-child(2) {
					   background: linear-gradient(to right, #b5d2f2, #fff 80%);
					}
					.single:nth-child(3) {
					   background: linear-gradient(to right, #e7c7cc, #fff 80%);
					}
				}
			}
		}
	}
</style>